/**
 * @file	BidirectionalComm.h
 * @author	chipsea
 * @brief	
 * @version	0.1
 * @date	2021-01-07
 * @copyright Copyright (c) 2021, CHIPSEA Co., Ltd.
 * @note
 */

#ifndef __BIDIRECTIONALCOMM_H
#define __BIDIRECTIONALCOMM_H

#ifdef __cplusplus
extern "C"
{
#endif

/*********************************************************************
 * INCLUDES
 */

/*********************************************************************
 * CONSTANTS
 */
#define RF_RETRANSMIT_TIME					5			//5ms
#define RF_RETRANSMIT_CNT_LIMIT				100			//transmit count limit
	
	
// RF Task Events
#define RF_RETRANSMIT_EVT			0x0001		//RF retransmit event, time period is 5ms
#define RF_TRANSMIT_EVT				0x0002		//RF transmit event
#define USR_UART_RCV_DATA_EVT		0x0004
#define USR_RF_RCV_DATA				0x0008


#define UART_BUF_SIZE	0x400
typedef struct
{
	uint16_t wr;
	uint16_t rd;
	uint8_t  data[UART_BUF_SIZE];
} uart_data_t;

/*********************************************************************
 * MACROS
 */

/*********************************************************************
 * FUNCTIONS
 */

/*
 * Task Initialization for the RF birectional communication Application
 */
extern void BidirectionalComm_Init( uint8 task_id );

/*
 * Task Event Processor for the RF birectional communication Application
 */
extern uint16 BidirectionalComm_ProcessEvent( uint8 task_id, uint16 events );

/*********************************************************************
*********************************************************************/

#ifdef __cplusplus
}
#endif

#endif /* __BIDIRECTIONALCOMM_H */
